<#-- 导入变量定义文件 -->
<#include "../template/include/assign.ftl">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>角色列表页</title>
<#-- 导入静态资源文件 -->
<#include "../template/include/source.ftl">
<link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	.page{
		float:right;
		padding-top: 15px;
		margin-right: 15px;
	}
</style>
</head>
<#include "../template/template_listPage.ftl">
<body class="list">
	<script type="text/javascript">
	$().ready( function() {
		<#if actionErrors??&&(actionErrors?size > 0)>
			$.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
			 modal: true, autoCloseTime: 3000});
		</#if>
	
	});
	
    function deleteRole(code){
	var submit = function (v, h, f) {
                if (v == 'ok')  {
                    var url="${web_base}/system/role!delete.htm?roleId="+code;
                    document.forms[0].action=url;
					document.forms[0].submit();
                }  else if (v == 'cancel')  {

                }
                return true; //close
            };
     $.jBox.confirm("你确认要删除吗?", "温罄提示", submit);
 }
    
	</script>
	<div class="body">
		<div class="listBar">
			<h1><span class="icon">&nbsp;</span>角色列表&nbsp;
		</div>
		<@pageList page=(page!) id="listForm" action="${web_base}/system/role!list.htm" query="roleQuery" isEmpty=true >
		<div class="operateBar">
		<input type="button" class="addButton" onclick="location.href='${web_base}/system/role!add.htm'" value="添加角色" /></h1>
			<label>角色名称:</label>
			<input type="text" name="roleQuery.roleName" value="${(roleQuery.roleName)!}" />
			<input type="submit" id="searchButton" class="searchButton" value="" />
		</div>		
		<table class="listTable">
			<tr>
				<th width="80">
					<span class="" name="id">角色编号</span>
				</th>
				<th width="80">
					<span class="" name="name">角色名称</span>
				</th>
				<th>
					<span class="" name="permission">权限集合</span>
				</th>
				<th width="80">
					操作
				</th>								
			</tr>
		<#if  page??&&page.list??&&(page.list?size gt 0) >
		<#list page.list as entry>
			<tr>
				<td width="80">
					${(entry.roleId)!}
				</td>
				<td width="80">
					${(entry.roleName)!}
				</td>
				<td>
					<#if entry.menuList?? >
                        <#list entry.menuList as m>
                            <#if m_index<=26>
                            ${(m.menuName)!} /
                            </#if>
                        </#list>
                        <#if 26<=entry.menuList.size()>...</#if>
                      </#if>
				</td>
				<td width="80">
					<a href="${web_base}/system/role!toEdit.htm?roleId=${(entry.roleId)!}" title="编辑">[编辑]</a>
					<a href="javascript:void(0);" onclick="deleteRole('${(entry.roleId)!}');" title="删除">[删除]</a>
				</td>				
			</tr>
		</#list>
		<#else>
		    <tr><td colspan="9">
			<div class="noRecord">
				没有找到任何记录!
			</div>	
			</td></tr>
		</#if>
		</table>
		</@pageList>
	</div>
</body>
